<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台首页</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easy14/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easy14/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easy14/locale/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easy14/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easy14/themes/icon.css"/>
    <script type="text/javascript">
       $(function(){
           $('#nav').tree({
               url:'${pageContext.request.contextPath}/role/getRoles',
               lines:true,
               onLoadSuccess:function(node,data){
                   var _this = this;
                   if(data){
                       $(data).each(function(index,value){
                             if(this.state == 'closed'){
                                 $(_this).tree('expandAll');
                             }
                       });
                   }
               },
               onClick:function(node){
                    if(node.urlName){
                         if($('#tabs').tabs('exists',node.text)){
                             $('#tabs').tabs('select',node.text);
                         }else{
                             $('#tabs').tabs('add',{
                                 title:node.text,
                                 closable:true,
                                 href:node.urlName
                             })
                         }
                    }
               }
           });

           $('#tabs').tabs({
               fit:true,
               border:false
           });
       })
    </script>
</head>
<body class="easyui-layout">
    <div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px"><strong>杨鲁华的后台管理系统</strong></div>
    <div data-options="region:'west',split:true,title:'菜单'" style="width:150px;padding:10px;" id="nav"></div>
    <%--<div data-options="region:'east',split:true,collapsed:true,title:'East'" style="width:100px;padding:10px;">east region</div>
    <div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>--%>
    <div data-options="region:'center'" style="overflow: hidden">
        <div id="tabs">
            <div title="起始页" style="padding: 0 10px;display: block;">
                恭喜你进入起始页
            </div>
        </div>
    </div>
</body>
</html>
